package com.yjf.crud;

import cn.hutool.json.JSONArray;
import com.yjf.crud.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/test")
public class TestController {
    @Resource
    UserService userService;

    @GetMapping("/testMethod")
    public String  testMethod() {
        List<Map<String,Object>>  lista = userService.master();
        List<Map<String,Object>>  listb = userService.slave();
        lista.addAll(listb);
        return new JSONArray(lista).toStringPretty();
    }
}
